﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GriffinWebService.Entity;
using GriffinWebService.DALC;

namespace GriffinWebService.BO
{
    public class EvaluationBO
    {
        #region [Member Variables]
        EvaluationDALC evaluationDALC = new EvaluationDALC();
        #endregion

        #region Methods
        public List<Evaluation> getCateEvaluation(int cateID, out string errormsg)
        {
            errormsg = string.Empty;
            return evaluationDALC.getCateEvaluation( cateID);
        }

        public decimal getSiteEvaluation(int userID, int siteID, out string errormsg)
        {
            errormsg = string.Empty;
            return evaluationDALC.getSiteEvaluation(userID, siteID);
        }

        public int setEvaluation(int userID, int siteID, int cateid, string strEvaluationNumber, out string errormsg)
        {
            errormsg = string.Empty;
            decimal evaluationNumber;
            if (decimal.TryParse(strEvaluationNumber, out evaluationNumber))
            {
                return evaluationDALC.setEvaluation(userID, siteID, cateid, evaluationNumber);
            }
            else
            {
                return 0;
            }
        }
        #endregion

    }
}